<template>
  <div class="content">
    <div class="view">
      <van-cell-group>
        <van-uploader accept="image/*"
                      deletable
                      v-model="fileList"
                      :after-read="afterRead" />
      </van-cell-group>
      <van-cell-group>
        <van-field
            label="名称"
            type="textarea"
            placeholder="请描述蔬菜"
            rows="1"
            autosize
            required
        />
      </van-cell-group>
    </div>
    <div class="footer">
      <van-button class="btn" type="primary" @click="submit">发布</van-button>
    </div>
  </div>
</template>
<script setup>
import { ref } from 'vue'
const fileList = ref([])

const formData = ref({

})
const afterRead = (files, detail) => {
  files.status = null
}

const submit = async() =>{
  console.log(fileList.value)
}
</script>

<style lang="less" scoped>
.content{
  padding:0.5rem;
  box-sizing: border-box;
  width:100%;
  .view{
    overflow-y:auto;
  }
  .footer{
    margin-top: 6rem;
    height:3rem;
    width:100%;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    .btn{
      width :80%;
    }
  }
}
</style>